package com.sc.mapper;

import com.sc.pojo.Postcomments;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PostcommentsMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Postcomments record);

    int insertSelective(Postcomments record);

    Postcomments selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Postcomments record);

    int updateByPrimaryKey(Postcomments record);

    List<Postcomments> selectByPostid(Integer postid);

    //给该帖子评论数加一
    int addPostComments(Integer postid);
    //给该帖子评论数减一
    int subPostComments(Integer postid);

    //给用户_评论表加一条记录
    int addUserComment(@Param("postid") Integer postid,@Param("commentsid") Integer commentsid);
    //给用户_评论表减少一条记录
    int subUserComment(@Param("postid") Integer postid,@Param("commentsid") Integer commentsid);

    List<Postcomments> show();

    List<Postcomments> search(String str);
}